#include "libs.h"
#include "util.h"
#include "core.h"
#include "app.h"

#include "app/OA/H3DKnight.h"
#include "app/OA/h3dcrowd.h"

int main() {
	try {
		gLog.add(new std::ofstream("global.log"));
		gLog.setOutputFlags(&std::cout, core::Logger::LOG_ALL);

		gLog << "Starting Overdrive Assault...";

		boost::shared_ptr<app::Application> theApplication(new app::H3DCrowd());

		core::Engine engine;
		engine.setApplication(theApplication);
		engine.run();

		std::cout << "\n";

		gLog << "Terminating application";
	}
	catch (std::exception e) {
		std::cerr << e.what() << std::endl;
	}
	catch (...) {
		std::cerr << "Unknown exception" << std::endl;
	}
	
	return 0;
}